From ecd46a7523aae288bf1370be8e02e5d3cf52495c Mon Sep 17 00:00:00 2001 From: oliskoli Date: Mon, 21 Nov 2005 23:19:11 +0000 Subject: [PATCH] Enhanced filter list -%1 in same manner like format's -^3 output. --- gpsbabel/filter_vecs.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gpsbabel/filter_vecs.c b/gpsbabel/filter_vecs.c index 0249b3a24..3b4a5feb8 100644 --- a/gpsbabel/filter_vecs.c +++ b/gpsbabel/filter_vecs.c @@ -225,6 +225,24 @@ alpha (const void *a, const void *b) return case_ignore_strcmp(ap->desc , bp->desc); } +static void +disp_v1(const fl_vecs_t *vec) +{ + arglist_t *ap; + + for (ap = vec->vec->args; ap && ap->argstring; ap++) { + if ( !(ap->argtype & ARGTYPE_HIDDEN)) + printf("option\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", + vec->name, + ap->argstring, + ap->helpstring, + name_option(ap->argtype), + ap->defaultvalue? ap->defaultvalue : "", + ap->minvalue? ap->minvalue : "", + ap->maxvalue? ap->maxvalue : ""); + } +} + /* * Display the available formats in a format that's easy to machine * parse. Typically invoked by programs like graphical wrappers to @@ -243,8 +261,11 @@ disp_filters(int version) switch(version) { case 0: + case 1: for (vec = filter_vec_list; vec->vec; vec++) { printf("%s\t%s\n", vec->name, vec->desc); + if (version > 0) + disp_v1(vec); } break; default: -- 2.30.2